package com.y.config.exception;

import com.y.entity.vo.RHttpStatusEnum;


public class BusinessException extends  RuntimeException {


    private Integer code;
    private String message;

    public BusinessException(Integer code,String message) {
        this.code = code;
        this.message = message;
    }

    public BusinessException(RHttpStatusEnum rHttpStatusEnum) {
        this.code = rHttpStatusEnum.getCode();
        this.message = rHttpStatusEnum.getMessage();
    }

    @Override
    public String getMessage() {
        return message;
    }

    public Integer getCode() {
        return code;
    }
}
